home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
exitwi
/
exitdlg.frm
< prev
next >
Wrap
Text File
|
1995-12-05
|
4KB
|
187 lines
VERSION 2.00
Begin Form ExitDlg
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Double
Caption = "Windows Exit"
ClientHeight = 1590
ClientLeft = 1485
ClientTop = 1815
ClientWidth = 4455
ForeColor = &H00000000&
Height = 2280
Left = 1425
LinkMode = 1 'Source
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1590
ScaleWidth = 4455
Top = 1185
Width = 4575
Begin CommandButton Command5
Caption = "&Quit"
Height = 375
Left = 3360
TabIndex = 6
Top = 720
Width = 855
End
Begin CommandButton Command4
Caption = "O&K"
Height = 375
Left = 240
TabIndex = 5
Top = 720
Width = 855
End
Begin CommandButton Command3
Caption = "Re&boot System"
Height = 495
Left = 3000
TabIndex = 4
Top = 120
Width = 1455
End
Begin CommandButton Command2
Caption = "&Restart Windows"
Height = 495
Left = 1320
TabIndex = 3
Top = 120
Width = 1695
End
Begin CommandButton Exit
Caption = "E&xit Windows"
Height = 495
Left = 0
TabIndex = 2
Top = 120
Width = 1335
End
Begin CommandButton cmd_Cancel
Cancel = -1 'True
Caption = "&Cancel"
Height = 375
HelpContextID = 102
Left = 1800
TabIndex = 0
Top = 720
Width = 975
End
Begin CheckBox check_OnTop
BackColor = &H00C0C0C0&
Caption = "Always On Top"
ForeColor = &H00FF0000&
Height = 255
HelpContextID = 103
Left = 1440
TabIndex = 1
Top = 1320
Width = 1695
End
Begin Menu Quit
Caption = "&Quit"
End
Begin Menu About
Caption = "&About"
End
End
Sub About_Click ()
Aboutbox.Show Modal
End Sub
Sub check_OnTop_Click ()
Dim R As Integer
If check_OnTop.Value Then
SetWindowPos ExitWin.hWnd, HWND_TOPMOST, 0, 0, 0, 0, &H40
Else
SetWindowPos ExitWin.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, &H40
End If
Exitdlg.SetFocus
R = WriteProfileString(APP_EXITWIN, KEY_ONTOP, Trim$(Str$(check_OnTop.Value)))
End Sub
Sub cmd_Cancel_Click ()
UnloadExitwindlg
End Sub
Sub Command1_Click ()
R = ExitWindows(&H0, 0)
End Sub
Sub Command2_Click ()
R = ExitWindows(EW_RESTARTWINDOWS, &H0)
End Sub
Sub Command3_Click ()
R = ExitWindows(EW_REBOOTSYSTEM, &H0)
End Sub
Sub Command4_Click ()
UnloadExitwindlg
End Sub
Sub Command5_Click ()
End
End Sub
Sub End_Click ()
End
End Sub
Sub Exit_Click ()
R = ExitWindows(&H0, 0)
End Sub
Sub Exwin_Click ()
R = ExitWindows(&H0, 0)
End Sub
Sub Form_Load ()
Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
RemoveSysMenuItems Exitdlg
Show
check_OnTop.Value = OnTop
End Sub
Sub Quit_Click ()
End
End Sub
Sub RebootComputer_Click ()
R = ExitWindows(EW_REBOOTSYSTEM, &H0)
End Sub
Sub RemoveSysMenuItems (AForm As Form)
Dim HSysMenu As Integer, R As Integer
HSysMenu = GetSystemMenu(AForm.hWnd, 0)
R = RemoveMenu(HSysMenu, 8, MF_BYPOSITION)
R = RemoveMenu(HSysMenu, 7, MF_BYPOSITION)
R = RemoveMenu(HSysMenu, 5, MF_BYPOSITION)
End Sub
Sub RestartWindows_Click ()
R = ExitWindows(EW_RESTARTWINDOWS, &H0)
End Sub
Sub UnloadExitwindlg ()
Unload Exitdlg
ExitWin.Picture = ExitWin.pic_Closed.Picture
End Sub